package com.hospital.user.ctluo.servlce.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hospital.user.ctluo.dao.ChaMapper;
import com.hospital.user.ctluo.entity.CtInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChaServlce implements com.hospital.user.ctluo.servlce.ChaServlce {
    @Autowired
    ChaMapper mapper;

    @Override
    public PageInfo<CtInfo> findByPage(Integer curr, Integer ctId, String name) {
        PageHelper.startPage(curr, 5);//设置起始页数和显示页数
        List<CtInfo> ctInfos = mapper.totalCount(ctId, name);//查询到数据集合
        PageInfo<CtInfo> pageInfo = new PageInfo<>(ctInfos);
        return pageInfo;//返回page
    }

}
